<!DOCTYPE HTML>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title>Our Love Story</title>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<style type="text/css">
		@font-face {
			font-family: digit;
			src: url('digital-7_mono.ttf') format("truetype");
		}
	</style>
	<link href="css/default.css" type="text/css" rel="stylesheet">
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/garden_dev.js"></script>
    <script type="text/javascript" src="js/functions_dev.js"></script>
</head>

<body>
	<div id="mainDiv">
		<div id="content">    
			<div id="code">
				<span class="comments">/**</span><br />
				<span class="space"/><span class="comments">* This is the first birthday I celebrate for you,but I do nothing,making you depressed </span><br />
				<span class="space"/><span class="comments">*so I write some code to celebrate your birthday,hope it's still not too late</span><br />
				<span class="space"/><span class="comments">*/</span><br />
				Boy i = <span class="keyword">new</span> Boy(<span class="string">"sxiong"</span>);<br />
				Girl u = <span class="keyword">new</span> Girl(<span class="string">"leiy"</span>);<br />
				WE we = <span class="keyword">new</span> WE(<span class="string">"leiy and sxiong"</span>);<br />

				<span class="comments">// 2014 08 03, you told me never to watch movie with any other girls  </span><br />
				u.told(i);<br />
				<span class="comments">// I seem to be excited about this news,because I have fall in love with you , before you told me </span><br />
				i.amExcited();<br />
                <span class="comments">// Since then, we fall in love with each other</span><br />
				we.fallInLove();<br/>
				<span class="comments">// I miss u every day.</span><br />
				i.miss(u);<br />
				<span class="comments">// And take care of u and our love.</span><br />
				i.takeCareOf(u);<br />
				<span class="comments">// You say that you won't be so easy to marry me.</span><br />
				<span class="comments">// So I keep waiting and I have confidence that you will.</span><br />
				<span class="keyword">boolean</span> isHesitate = <span class="keyword">true</span>;<br />
				<span class="keyword">while</span> (isHesitate) {<br />
				<span class="placeholder"/>i.waitFor(u);<br />
				<span class="placeholder"/><span class="comments">// I think it is an important decision</span><br />
				<span class="placeholder"/><span class="comments">// and you should think it over.</span><br />
				<span class="placeholder"/>isHesitate = u.thinkOver();<br />
				}<br />
				<span class="comments">// After a romantic wedding, we will live happily ever after.</span><br />
				i.marry(u);<br />
				i.liveHappilyWith(u);<br />
				<span class="comments">At last</span><br />
				i.tell(u);<br />
				<span class="comments">// Yesterday is your birthday,but i do nothing ,rather told you to reciew you books for exams,how stupid i was,just like a pig ,ahaha.
				I am so sorry for that.I promise that I like you ,I miss you,I just thought you were busy in revising for the examination,so i din't disturb you.
				I have realized the mistakes I have made.I should have take care of your health,not just too studying.But what you said tonight is wrong too,because you were 
				always in my heart,never miss!In a word,I miss you,want to kiss you,aplogize for doing nothing for your birthday yesterday.</span><br />
			</div>
			<div id="loveHeart">
				<canvas id="garden"></canvas>
				<div id="words">
					<div id="messages">
						Leiy, I have fallen in love with you for
						<div id="elapseClock"></div>
					</div>
					<div id="loveu">
						Happy birthday for u,and <br/>love u forever and ever.<br/>
						<div class="signature">- sxiong</div>
					</div>
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript">
		var offsetX = $("#loveHeart").width() / 2;
		var offsetY = $("#loveHeart").height() / 2 - 55;
		var displayMode = 1;
		var together = new Date();
		together.setFullYear(2014);
		together.setMonth(07);
		together.setDate(03);
		together.setHours(20);
		together.setMinutes(0);
		together.setSeconds(0);
		together.setMilliseconds(0);
		
		$("#loveHeart").click(function(){
			displayMode *= -1;
			timeElapse(together, displayMode);
		});
		
		if (!document.createElement('canvas').getContext) {
			var msg = document.createElement("div");
			msg.id = "errorMsg";
			msg.innerHTML = "大大，如果你看到了这条消息，说明你的浏览器不支持HTML 5<br/>试下用Chrome/IE 9等试试看，爱你！"; 
			document.body.appendChild(msg);
			$("#code").css("display", "none")
			$("#copyright").css("position", "absolute");
			$("#copyright").css("bottom", "10px");
		    document.execCommand("stop");
		} else {
			setTimeout(function () {
				adjustWordsPosition();
				startHeartAnimation();
			}, 5000);

			timeElapse(together, displayMode);
			setInterval(function () {
				timeElapse(together, displayMode);
			}, 500);

			adjustCodePosition();
			$("#code").typewriter();
		}
	</script>
</body>
</html>
